import "@moonbeam-network/api-augment";
import { describeSuite, expect, beforeEach } from "@moonwall/cli";
import { u8aToHex } from "@polkadot/util";

describeSuite({
  id: "D022825",
  title: "Precompiles - ecPairing",
  foundationMethods: "dev",
  testCases: ({ context, it, log }) => {
    let contractAddress: `0x${string}`;

    beforeEach(async () => {
      const { contractAddress: deployedAddr } = await context.deployContract!("PairingChecker");
      await context.createBlock();
      contractAddress = deployedAddr;
    });

    it({
      id: "T01",
      title: "returns success on alt_bn128_pairing_jeff1",
      test: async function () {
        const byteArray = new Uint8Array([
          28, 118, 71, 111, 77, 239, 75, 185, 69, 65, 213, 126, 187, 161, 25, 51, 129, 255, 167,
          170, 118, 173, 166, 100, 221, 49, 193, 96, 36, 196, 63, 89, 48, 52, 221, 41, 32, 246, 115,
          226, 4, 254, 226, 129, 28, 103, 135, 69, 252, 129, 155, 85, 211, 233, 210, 148, 228, 92,
          155, 3, 167, 106, 239, 65, 32, 157, 209, 94, 191, 245, 212, 108, 75, 216, 136, 229, 26,
          147, 207, 153, 167, 50, 150, 54, 198, 53, 20, 57, 107, 74, 69, 32, 3, 163, 91, 247, 4,
          191, 17, 202, 1, 72, 59, 250, 139, 52, 180, 53, 97, 132, 141, 40, 144, 89, 96, 17, 76,
          138, 192, 64, 73, 175, 75, 99, 21, 164, 22, 120, 43, 184, 50, 74, 246, 207, 201, 53, 55,
          162, 173, 26, 68, 92, 253, 12, 162, 167, 26, 205, 122, 196, 31, 173, 191, 147, 60, 42, 81,
          190, 52, 77, 18, 10, 42, 76, 243, 12, 27, 249, 132, 95, 32, 198, 254, 57, 224, 126, 162,
          204, 230, 31, 12, 155, 176, 72, 22, 95, 229, 228, 222, 135, 117, 80, 17, 30, 18, 159, 28,
          241, 9, 119, 16, 212, 28, 74, 199, 15, 205, 250, 91, 162, 2, 60, 111, 241, 203, 234, 195,
          34, 222, 73, 209, 182, 223, 124, 32, 50, 198, 26, 131, 14, 60, 23, 40, 109, 233, 70, 43,
          242, 66, 252, 162, 136, 53, 133, 185, 56, 112, 167, 56, 83, 250, 206, 106, 107, 244, 17,
          25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51,
          53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118,
          66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92,
          217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51,
          149, 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200,
          94, 165, 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12,
          67, 211, 123, 76, 230, 204, 1, 102, 250, 125, 170,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T02",
      title: "returns success on alt_bn128_pairing_jeff2",
      test: async function () {
        const byteArray = new Uint8Array([
          46, 202, 12, 114, 56, 191, 22, 232, 62, 122, 30, 108, 93, 73, 84, 6, 133, 255, 81, 56, 15,
          48, 152, 66, 169, 133, 97, 85, 128, 25, 252, 2, 3, 211, 38, 3, 97, 187, 132, 81, 222, 95,
          245, 236, 209, 127, 1, 15, 242, 47, 92, 49, 205, 241, 132, 233, 2, 11, 6, 250, 89, 151,
          219, 132, 18, 19, 210, 20, 155, 0, 97, 55, 252, 251, 35, 3, 102, 6, 248, 72, 214, 56, 213,
          118, 161, 32, 202, 152, 27, 91, 26, 95, 147, 0, 179, 238, 34, 118, 207, 115, 12, 244, 147,
          205, 149, 214, 70, 119, 187, 183, 95, 196, 45, 183, 37, 19, 164, 193, 227, 135, 180, 118,
          208, 86, 248, 10, 167, 95, 33, 238, 98, 38, 211, 20, 38, 50, 42, 252, 218, 98, 20, 100,
          208, 97, 29, 34, 103, 131, 38, 46, 33, 187, 59, 200, 107, 83, 126, 152, 98, 55, 9, 109,
          241, 248, 45, 255, 51, 125, 213, 151, 46, 50, 168, 173, 67, 226, 138, 120, 169, 106, 130,
          62, 241, 205, 77, 235, 225, 43, 101, 82, 234, 95, 6, 150, 122, 18, 55, 235, 254, 202, 154,
          170, 224, 214, 208, 186, 184, 226, 140, 25, 140, 90, 51, 158, 248, 162, 64, 126, 49, 205,
          172, 81, 109, 185, 34, 22, 15, 162, 87, 165, 253, 91, 40, 6, 66, 255, 71, 182, 94, 202,
          119, 230, 38, 203, 104, 92, 132, 250, 109, 59, 104, 130, 162, 131, 221, 209, 25, 142, 147,
          147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169, 231,
          18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0,
          102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146,
          246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75,
          49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219,
          140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123,
          76, 230, 204, 1, 102, 250, 125, 170,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T03",
      title: "returns success on alt_bn128_pairing_jeff3",
      test: async function () {
        const byteArray = new Uint8Array([
          15, 37, 146, 155, 203, 67, 213, 165, 115, 145, 86, 70, 21, 201, 231, 10, 153, 43, 16, 234,
          250, 77, 177, 9, 112, 150, 73, 207, 72, 197, 13, 210, 22, 218, 47, 92, 182, 190, 122, 10,
          167, 44, 68, 12, 83, 201, 187, 223, 236, 108, 54, 199, 213, 21, 83, 100, 49, 179, 168,
          101, 70, 138, 203, 186, 46, 137, 113, 138, 211, 60, 139, 237, 146, 226, 16, 232, 29, 24,
          83, 67, 83, 153, 162, 113, 145, 58, 101, 32, 115, 106, 71, 41, 207, 13, 81, 235, 1, 169,
          226, 255, 162, 233, 37, 153, 182, 142, 68, 222, 91, 207, 53, 79, 162, 100, 43, 212, 242,
          107, 37, 157, 170, 111, 124, 227, 237, 87, 174, 179, 20, 169, 168, 123, 120, 154, 88, 175,
          73, 155, 49, 78, 19, 195, 214, 91, 237, 229, 108, 7, 234, 45, 65, 141, 104, 116, 133, 123,
          112, 118, 55, 19, 23, 143, 180, 154, 45, 108, 211, 71, 220, 88, 151, 63, 244, 150, 19,
          162, 7, 87, 208, 252, 194, 32, 121, 249, 171, 209, 12, 59, 174, 226, 69, 144, 27, 158, 2,
          123, 213, 207, 194, 203, 93, 184, 45, 77, 201, 103, 122, 199, 149, 236, 80, 14, 205, 71,
          222, 238, 59, 93, 160, 6, 214, 208, 73, 184, 17, 215, 81, 28, 120, 21, 141, 228, 132, 35,
          47, 198, 141, 175, 138, 69, 207, 33, 125, 28, 47, 174, 105, 63, 245, 135, 30, 135, 82,
          215, 59, 33, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241,
          170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18,
          31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70,
          222, 189, 92, 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173,
          105, 12, 51, 149, 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151,
          91, 18, 200, 94, 165, 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209,
          231, 105, 12, 67, 211, 123, 76, 230, 204, 1, 102, 250, 125, 170,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T04",
      title: "returns success on alt_bn128_pairing_jeff4",
      test: async function () {
        const byteArray = new Uint8Array([
          47, 46, 160, 179, 218, 30, 142, 241, 25, 20, 172, 248, 178, 225, 179, 45, 153, 223, 81,
          245, 244, 242, 6, 252, 107, 148, 126, 174, 134, 14, 221, 182, 6, 129, 52, 221, 179, 61,
          200, 136, 239, 68, 107, 100, 141, 114, 51, 134, 132, 214, 120, 210, 235, 35, 113, 198, 26,
          80, 115, 77, 120, 218, 75, 114, 37, 248, 60, 139, 106, 185, 222, 116, 231, 218, 72, 142,
          240, 38, 69, 197, 161, 106, 102, 82, 195, 199, 26, 21, 220, 55, 254, 58, 93, 203, 124,
          177, 34, 172, 222, 221, 99, 8, 227, 187, 35, 13, 34, 109, 22, 161, 5, 41, 95, 82, 58, 138,
          2, 191, 197, 232, 189, 45, 161, 53, 172, 76, 36, 93, 6, 91, 186, 217, 46, 124, 78, 49,
          191, 55, 87, 241, 254, 115, 98, 166, 63, 191, 238, 80, 231, 220, 104, 218, 17, 110, 103,
          214, 0, 217, 191, 104, 6, 211, 2, 88, 13, 192, 102, 16, 2, 153, 78, 124, 211, 167, 242,
          36, 231, 221, 194, 120, 2, 119, 116, 134, 191, 128, 244, 14, 76, 163, 207, 219, 24, 107,
          172, 81, 136, 169, 140, 69, 230, 1, 104, 115, 209, 7, 245, 205, 19, 31, 58, 62, 51, 157,
          3, 117, 229, 139, 214, 33, 147, 71, 176, 8, 18, 42, 226, 176, 158, 83, 158, 21, 46, 197,
          54, 78, 126, 34, 4, 176, 61, 17, 211, 202, 160, 56, 191, 199, 205, 73, 159, 129, 118, 170,
          203, 238, 31, 57, 228, 228, 175, 196, 188, 116, 121, 10, 74, 2, 138, 255, 44, 61, 37, 56,
          115, 31, 183, 85, 237, 239, 216, 203, 72, 214, 234, 88, 155, 94, 40, 63, 21, 7, 148, 182,
          115, 111, 103, 13, 106, 16, 51, 249, 180, 108, 111, 82, 4, 245, 8, 19, 235, 133, 200, 220,
          75, 89, 219, 28, 93, 57, 20, 13, 151, 238, 77, 43, 54, 217, 155, 196, 153, 116, 209, 142,
          204, 163, 231, 173, 81, 1, 25, 86, 5, 27, 70, 77, 158, 39, 212, 108, 194, 94, 7, 100, 187,
          152, 87, 91, 212, 102, 211, 45, 183, 177, 95, 88, 43, 45, 92, 69, 43, 54, 170, 57, 75,
          120, 147, 102, 229, 227, 202, 90, 171, 212, 21, 121, 74, 176, 97, 68, 30, 81, 208, 30,
          148, 100, 11, 126, 48, 132, 160, 126, 2, 199, 140, 243, 16, 60, 84, 43, 197, 178, 152,
          102, 159, 33, 27, 136, 218, 22, 121, 176, 182, 74, 99, 183, 224, 231, 191, 229, 42, 174,
          82, 79, 115, 165, 91, 231, 254, 112, 199, 233, 191, 201, 75, 76, 240, 218, 18, 19, 210,
          20, 155, 0, 97, 55, 252, 251, 35, 3, 102, 6, 248, 72, 214, 56, 213, 118, 161, 32, 202,
          152, 27, 91, 26, 95, 147, 0, 179, 238, 34, 118, 207, 115, 12, 244, 147, 205, 149, 214, 70,
          119, 187, 183, 95, 196, 45, 183, 37, 19, 164, 193, 227, 135, 180, 118, 208, 86, 248, 10,
          167, 95, 33, 238, 98, 38, 211, 20, 38, 50, 42, 252, 218, 98, 20, 100, 208, 97, 29, 34,
          103, 131, 38, 46, 33, 187, 59, 200, 107, 83, 126, 152, 98, 55, 9, 109, 241, 248, 45, 255,
          51, 125, 213, 151, 46, 50, 168, 173, 67, 226, 138, 120, 169, 106, 130, 62, 241, 205, 77,
          235, 225, 43, 101, 82, 234, 95,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T05",
      title: "returns success on alt_bn128_pairing_jeff5",
      test: async function () {
        const byteArray = new Uint8Array([
          32, 167, 84, 210, 7, 29, 77, 83, 144, 62, 59, 49, 167, 233, 138, 214, 136, 45, 88, 174,
          194, 64, 239, 152, 31, 223, 10, 157, 34, 197, 146, 106, 41, 200, 83, 252, 234, 120, 152,
          135, 49, 89, 22, 187, 235, 137, 202, 55, 237, 179, 85, 180, 249, 128, 201, 161, 42, 148,
          243, 13, 238, 237, 48, 33, 18, 19, 210, 20, 155, 0, 97, 55, 252, 251, 35, 3, 102, 6, 248,
          72, 214, 56, 213, 118, 161, 32, 202, 152, 27, 91, 26, 95, 147, 0, 179, 238, 34, 118, 207,
          115, 12, 244, 147, 205, 149, 214, 70, 119, 187, 183, 95, 196, 45, 183, 37, 19, 164, 193,
          227, 135, 180, 118, 208, 86, 248, 10, 167, 95, 33, 238, 98, 38, 211, 20, 38, 50, 42, 252,
          218, 98, 20, 100, 208, 97, 29, 34, 103, 131, 38, 46, 33, 187, 59, 200, 107, 83, 126, 152,
          98, 55, 9, 109, 241, 248, 45, 255, 51, 125, 213, 151, 46, 50, 168, 173, 67, 226, 138, 120,
          169, 106, 130, 62, 241, 205, 77, 235, 225, 43, 101, 82, 234, 95, 26, 187, 74, 37, 235,
          147, 121, 174, 150, 200, 79, 255, 159, 5, 64, 171, 207, 192, 160, 209, 26, 237, 160, 45,
          79, 55, 228, 186, 247, 76, 176, 193, 16, 115, 179, 255, 44, 219, 179, 135, 85, 248, 105,
          30, 165, 158, 150, 6, 105, 107, 63, 242, 120, 172, 252, 9, 143, 168, 34, 100, 112, 208,
          56, 105, 33, 124, 238, 10, 154, 215, 154, 68, 147, 181, 37, 62, 46, 78, 58, 57, 252, 45,
          243, 132, 25, 242, 48, 211, 65, 246, 12, 176, 100, 160, 172, 41, 10, 61, 118, 241, 64,
          219, 132, 24, 186, 81, 34, 114, 56, 20, 70, 235, 115, 149, 134, 112, 240, 12, 244, 111,
          29, 158, 100, 203, 160, 87, 181, 60, 38, 246, 74, 142, 199, 3, 135, 161, 62, 65, 67, 14,
          211, 238, 74, 125, 178, 5, 156, 197, 252, 19, 192, 103, 25, 75, 204, 12, 180, 154, 152,
          85, 47, 215, 43, 217, 237, 182, 87, 52, 97, 39, 218, 19, 46, 91, 130, 171, 144, 143, 88,
          22, 200, 38, 172, 180, 153, 226, 47, 36, 18, 209, 162, 215, 15, 37, 146, 155, 203, 67,
          213, 165, 115, 145, 86, 70, 21, 201, 231, 10, 153, 43, 16, 234, 250, 77, 177, 9, 112, 150,
          73, 207, 72, 197, 13, 210, 25, 138, 31, 22, 42, 115, 38, 31, 17, 36, 1, 170, 45, 183, 156,
          125, 171, 21, 51, 201, 147, 92, 119, 41, 10, 108, 227, 177, 145, 242, 49, 141, 25, 142,
          147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169,
          231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106,
          0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146,
          246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75,
          49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219,
          140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123,
          76, 230, 204, 1, 102, 250, 125, 170,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T06",
      title: "returns false on alt_bn128_pairing_jeff6",
      test: async function () {
        const byteArray = new Uint8Array([
          28, 118, 71, 111, 77, 239, 75, 185, 69, 65, 213, 126, 187, 161, 25, 51, 129, 255, 167,
          170, 118, 173, 166, 100, 221, 49, 193, 96, 36, 196, 63, 89, 48, 52, 221, 41, 32, 246, 115,
          226, 4, 254, 226, 129, 28, 103, 135, 69, 252, 129, 155, 85, 211, 233, 210, 148, 228, 92,
          155, 3, 167, 106, 239, 65, 32, 157, 209, 94, 191, 245, 212, 108, 75, 216, 136, 229, 26,
          147, 207, 153, 167, 50, 150, 54, 198, 53, 20, 57, 107, 74, 69, 32, 3, 163, 91, 247, 4,
          191, 17, 202, 1, 72, 59, 250, 139, 52, 180, 53, 97, 132, 141, 40, 144, 89, 96, 17, 76,
          138, 192, 64, 73, 175, 75, 99, 21, 164, 22, 120, 43, 184, 50, 74, 246, 207, 201, 53, 55,
          162, 173, 26, 68, 92, 253, 12, 162, 167, 26, 205, 122, 196, 31, 173, 191, 147, 60, 42, 81,
          190, 52, 77, 18, 10, 42, 76, 243, 12, 27, 249, 132, 95, 32, 198, 254, 57, 224, 126, 162,
          204, 230, 31, 12, 155, 176, 72, 22, 95, 229, 228, 222, 135, 117, 80, 17, 30, 18, 159, 28,
          241, 9, 119, 16, 212, 28, 74, 199, 15, 205, 250, 91, 162, 2, 60, 111, 241, 203, 234, 195,
          34, 222, 73, 209, 182, 223, 124, 16, 49, 136, 88, 94, 35, 100, 18, 143, 226, 92, 112, 85,
          143, 21, 96, 244, 249, 53, 11, 175, 57, 89, 230, 3, 204, 145, 72, 110, 17, 9, 54, 25, 142,
          147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169,
          231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106,
          0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146,
          246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75,
          49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219,
          140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123,
          76, 230, 204, 1, 102, 250, 125, 170,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(false);
      },
    });

    it({
      id: "T07",
      title: "returns success on alt_bn128_pairing_empty_data",
      test: async function () {
        const byteArray = new Uint8Array([]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T08",
      title: "returns false on alt_bn128_pairing_one_point",
      test: async function () {
        const byteArray = new Uint8Array([
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 2, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241,
          170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18,
          31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70,
          222, 189, 92, 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173,
          105, 12, 51, 149, 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151,
          91, 18, 200, 94, 165, 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209,
          231, 105, 12, 67, 211, 123, 76, 230, 204, 1, 102, 250, 125, 170,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(false);
      },
    });

    it({
      id: "T09",
      title: "returns success on alt_bn128_pairing_two_point_match_2",
      test: async function () {
        const byteArray = new Uint8Array([
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 2, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241,
          170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18,
          31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70,
          222, 189, 92, 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173,
          105, 12, 51, 149, 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151,
          91, 18, 200, 94, 165, 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209,
          231, 105, 12, 67, 211, 123, 76, 230, 204, 1, 102, 250, 125, 170, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 142,
          147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169,
          231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106,
          0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146,
          246, 237, 39, 93, 196, 162, 136, 209, 175, 179, 203, 177, 172, 9, 24, 117, 36, 199, 219,
          54, 57, 93, 247, 190, 59, 153, 230, 115, 177, 58, 7, 90, 101, 236, 29, 155, 239, 205, 5,
          165, 50, 62, 109, 164, 212, 53, 243, 182, 23, 205, 179, 175, 131, 40, 92, 45, 247, 17,
          239, 57, 192, 21, 113, 130, 127, 157,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T10",
      title: "returns success on alt_bn128_pairing_two_point_match_3",
      test: async function () {
        const byteArray = new Uint8Array([
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 2, 32, 62, 32, 93, 180, 241, 155, 55, 182, 1, 33, 184, 58, 115, 51, 112, 109,
          184, 100, 49, 198, 216, 53, 132, 153, 87, 237, 140, 57, 40, 173, 121, 39, 220, 114, 52,
          253, 17, 211, 232, 195, 108, 89, 39, 124, 62, 111, 20, 157, 92, 211, 207, 169, 166, 42,
          238, 73, 248, 19, 9, 98, 180, 179, 185, 25, 94, 138, 165, 183, 130, 116, 99, 114, 43, 140,
          21, 57, 49, 87, 157, 53, 5, 86, 107, 78, 223, 72, 212, 152, 225, 133, 240, 80, 157, 225,
          82, 4, 187, 83, 184, 151, 126, 95, 146, 160, 188, 55, 39, 66, 196, 131, 9, 68, 165, 155,
          79, 230, 177, 192, 70, 110, 42, 109, 173, 18, 43, 93, 46, 3, 6, 68, 231, 46, 19, 26, 2,
          155, 133, 4, 91, 104, 24, 21, 133, 217, 120, 22, 169, 22, 135, 28, 168, 211, 194, 8, 193,
          109, 135, 207, 211, 26, 118, 218, 230, 211, 39, 35, 150, 208, 203, 230, 31, 206, 210, 188,
          83, 46, 218, 198, 71, 133, 30, 58, 197, 60, 225, 204, 156, 126, 100, 90, 131, 25, 142,
          147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169,
          231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106,
          0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146,
          246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75,
          49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219,
          140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123,
          76, 230, 204, 1, 102, 250, 125, 170,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T11",
      title: "returns success on alt_bn128_pairing_two_point_match_4",
      test: async function () {
        const byteArray = new Uint8Array([
          16, 84, 86, 163, 51, 230, 214, 54, 133, 79, 152, 126, 167, 187, 113, 61, 253, 10, 232, 55,
          26, 114, 174, 163, 19, 174, 12, 50, 192, 191, 16, 22, 12, 240, 49, 212, 27, 65, 85, 127,
          62, 126, 59, 160, 197, 27, 235, 229, 218, 142, 110, 205, 133, 94, 197, 15, 200, 126, 252,
          222, 172, 22, 139, 204, 4, 118, 190, 9, 58, 109, 43, 75, 191, 144, 113, 114, 4, 152, 116,
          175, 17, 225, 182, 38, 118, 6, 224, 8, 4, 211, 255, 0, 55, 236, 87, 253, 48, 16, 198, 140,
          181, 1, 97, 183, 209, 217, 107, 183, 30, 223, 236, 152, 128, 23, 25, 84, 229, 104, 113,
          171, 243, 217, 60, 201, 77, 116, 95, 161, 20, 192, 89, 215, 78, 91, 108, 78, 193, 74, 229,
          134, 78, 190, 35, 167, 23, 129, 216, 108, 41, 251, 143, 182, 204, 233, 79, 112, 211, 222,
          122, 33, 1, 179, 52, 97, 243, 157, 158, 136, 125, 187, 16, 15, 23, 10, 35, 69, 221, 227,
          192, 126, 37, 109, 29, 250, 43, 101, 123, 165, 205, 3, 4, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 26, 44, 48, 19,
          210, 234, 146, 225, 60, 128, 12, 222, 104, 239, 86, 162, 148, 184, 131, 246, 172, 53, 210,
          95, 88, 124, 9, 177, 179, 198, 53, 247, 41, 1, 88, 168, 12, 211, 214, 101, 48, 247, 77,
          201, 76, 148, 173, 184, 143, 92, 219, 72, 26, 204, 169, 151, 182, 230, 0, 113, 240, 138,
          17, 95, 47, 153, 127, 61, 189, 102, 167, 175, 224, 127, 231, 134, 44, 226, 57, 237, 186,
          158, 5, 197, 175, 255, 127, 138, 18, 89, 201, 115, 59, 45, 251, 185, 41, 209, 105, 21, 48,
          202, 112, 27, 74, 16, 96, 84, 104, 135, 40, 201, 151, 44, 133, 18, 233, 120, 158, 149,
          103, 170, 226, 62, 48, 44, 205, 117,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T12",
      title: "returns success on alt_bn128_pairing_ten_point_match_1",
      test: async function () {
        const byteArray = new Uint8Array([
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 2, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241,
          170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18,
          31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70,
          222, 189, 92, 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173,
          105, 12, 51, 149, 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151,
          91, 18, 200, 94, 165, 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209,
          231, 105, 12, 67, 211, 123, 76, 230, 204, 1, 102, 250, 125, 170, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 142,
          147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169,
          231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106,
          0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146,
          246, 237, 39, 93, 196, 162, 136, 209, 175, 179, 203, 177, 172, 9, 24, 117, 36, 199, 219,
          54, 57, 93, 247, 190, 59, 153, 230, 115, 177, 58, 7, 90, 101, 236, 29, 155, 239, 205, 5,
          165, 50, 62, 109, 164, 212, 53, 243, 182, 23, 205, 179, 175, 131, 40, 92, 45, 247, 17,
          239, 57, 192, 21, 113, 130, 127, 157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 142, 147, 147, 146, 13, 72, 58,
          114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18, 151, 228, 133,
          183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102, 94, 92, 68,
          121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146, 246, 237, 9, 6, 137,
          208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75, 49, 51, 112, 179,
          142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219, 140, 109, 235, 74,
          171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123, 76, 230, 204, 1,
          102, 250, 125, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183,
          49, 251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18,
          194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212,
          247, 94, 218, 221, 70, 222, 189, 92, 217, 146, 246, 237, 39, 93, 196, 162, 136, 209, 175,
          179, 203, 177, 172, 9, 24, 117, 36, 199, 219, 54, 57, 93, 247, 190, 59, 153, 230, 115,
          177, 58, 7, 90, 101, 236, 29, 155, 239, 205, 5, 165, 50, 62, 109, 164, 212, 53, 243, 182,
          23, 205, 179, 175, 131, 40, 92, 45, 247, 17, 239, 57, 192, 21, 113, 130, 127, 157, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 2, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170,
          73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31,
          30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222,
          189, 92, 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105,
          12, 51, 149, 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18,
          200, 94, 165, 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231,
          105, 12, 67, 211, 123, 76, 230, 204, 1, 102, 250, 125, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 142, 147, 147,
          146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18,
          151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102,
          94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146, 246,
          237, 39, 93, 196, 162, 136, 209, 175, 179, 203, 177, 172, 9, 24, 117, 36, 199, 219, 54,
          57, 93, 247, 190, 59, 153, 230, 115, 177, 58, 7, 90, 101, 236, 29, 155, 239, 205, 5, 165,
          50, 62, 109, 164, 212, 53, 243, 182, 23, 205, 179, 175, 131, 40, 92, 45, 247, 17, 239, 57,
          192, 21, 113, 130, 127, 157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96,
          191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174,
          243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67,
          34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146, 246, 237, 9, 6, 137, 208, 88, 95,
          240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75, 49, 51, 112, 179, 142, 243, 85,
          172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219, 140, 109, 235, 74, 171, 113, 128,
          141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123, 76, 230, 204, 1, 102, 250, 125,
          170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 2, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37,
          241, 170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222,
          239, 18, 31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218,
          221, 70, 222, 189, 92, 217, 146, 246, 237, 39, 93, 196, 162, 136, 209, 175, 179, 203, 177,
          172, 9, 24, 117, 36, 199, 219, 54, 57, 93, 247, 190, 59, 153, 230, 115, 177, 58, 7, 90,
          101, 236, 29, 155, 239, 205, 5, 165, 50, 62, 109, 164, 212, 53, 243, 182, 23, 205, 179,
          175, 131, 40, 92, 45, 247, 17, 239, 57, 192, 21, 113, 130, 127, 157, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 142,
          147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169,
          231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106,
          0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146,
          246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75,
          49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219,
          140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123,
          76, 230, 204, 1, 102, 250, 125, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 25, 142, 147, 147, 146, 13, 72, 58, 114,
          96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183,
          174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121,
          103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146, 246, 237, 39, 93, 196,
          162, 136, 209, 175, 179, 203, 177, 172, 9, 24, 117, 36, 199, 219, 54, 57, 93, 247, 190,
          59, 153, 230, 115, 177, 58, 7, 90, 101, 236, 29, 155, 239, 205, 5, 165, 50, 62, 109, 164,
          212, 53, 243, 182, 23, 205, 179, 175, 131, 40, 92, 45, 247, 17, 239, 57, 192, 21, 113,
          130, 127, 157,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T13",
      title: "returns success on alt_bn128_pairing_ten_point_match_2",
      test: async function () {
        const byteArray = new Uint8Array([
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 2, 32, 62, 32, 93, 180, 241, 155, 55, 182, 1, 33, 184, 58, 115, 51, 112, 109,
          184, 100, 49, 198, 216, 53, 132, 153, 87, 237, 140, 57, 40, 173, 121, 39, 220, 114, 52,
          253, 17, 211, 232, 195, 108, 89, 39, 124, 62, 111, 20, 157, 92, 211, 207, 169, 166, 42,
          238, 73, 248, 19, 9, 98, 180, 179, 185, 25, 94, 138, 165, 183, 130, 116, 99, 114, 43, 140,
          21, 57, 49, 87, 157, 53, 5, 86, 107, 78, 223, 72, 212, 152, 225, 133, 240, 80, 157, 225,
          82, 4, 187, 83, 184, 151, 126, 95, 146, 160, 188, 55, 39, 66, 196, 131, 9, 68, 165, 155,
          79, 230, 177, 192, 70, 110, 42, 109, 173, 18, 43, 93, 46, 3, 6, 68, 231, 46, 19, 26, 2,
          155, 133, 4, 91, 104, 24, 21, 133, 217, 120, 22, 169, 22, 135, 28, 168, 211, 194, 8, 193,
          109, 135, 207, 211, 26, 118, 218, 230, 211, 39, 35, 150, 208, 203, 230, 31, 206, 210, 188,
          83, 46, 218, 198, 71, 133, 30, 58, 197, 60, 225, 204, 156, 126, 100, 90, 131, 25, 142,
          147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169,
          231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106,
          0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146,
          246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75,
          49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219,
          140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123,
          76, 230, 204, 1, 102, 250, 125, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 62, 32, 93, 180, 241, 155, 55, 182, 1,
          33, 184, 58, 115, 51, 112, 109, 184, 100, 49, 198, 216, 53, 132, 153, 87, 237, 140, 57,
          40, 173, 121, 39, 220, 114, 52, 253, 17, 211, 232, 195, 108, 89, 39, 124, 62, 111, 20,
          157, 92, 211, 207, 169, 166, 42, 238, 73, 248, 19, 9, 98, 180, 179, 185, 25, 94, 138, 165,
          183, 130, 116, 99, 114, 43, 140, 21, 57, 49, 87, 157, 53, 5, 86, 107, 78, 223, 72, 212,
          152, 225, 133, 240, 80, 157, 225, 82, 4, 187, 83, 184, 151, 126, 95, 146, 160, 188, 55,
          39, 66, 196, 131, 9, 68, 165, 155, 79, 230, 177, 192, 70, 110, 42, 109, 173, 18, 43, 93,
          46, 3, 6, 68, 231, 46, 19, 26, 2, 155, 133, 4, 91, 104, 24, 21, 133, 217, 120, 22, 169,
          22, 135, 28, 168, 211, 194, 8, 193, 109, 135, 207, 211, 26, 118, 218, 230, 211, 39, 35,
          150, 208, 203, 230, 31, 206, 210, 188, 83, 46, 218, 198, 71, 133, 30, 58, 197, 60, 225,
          204, 156, 126, 100, 90, 131, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49,
          251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194,
          24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247,
          94, 218, 221, 70, 222, 189, 92, 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236,
          158, 153, 173, 105, 12, 51, 149, 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220,
          209, 34, 151, 91, 18, 200, 94, 165, 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64,
          143, 227, 209, 231, 105, 12, 67, 211, 123, 76, 230, 204, 1, 102, 250, 125, 170, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          2, 32, 62, 32, 93, 180, 241, 155, 55, 182, 1, 33, 184, 58, 115, 51, 112, 109, 184, 100,
          49, 198, 216, 53, 132, 153, 87, 237, 140, 57, 40, 173, 121, 39, 220, 114, 52, 253, 17,
          211, 232, 195, 108, 89, 39, 124, 62, 111, 20, 157, 92, 211, 207, 169, 166, 42, 238, 73,
          248, 19, 9, 98, 180, 179, 185, 25, 94, 138, 165, 183, 130, 116, 99, 114, 43, 140, 21, 57,
          49, 87, 157, 53, 5, 86, 107, 78, 223, 72, 212, 152, 225, 133, 240, 80, 157, 225, 82, 4,
          187, 83, 184, 151, 126, 95, 146, 160, 188, 55, 39, 66, 196, 131, 9, 68, 165, 155, 79, 230,
          177, 192, 70, 110, 42, 109, 173, 18, 43, 93, 46, 3, 6, 68, 231, 46, 19, 26, 2, 155, 133,
          4, 91, 104, 24, 21, 133, 217, 120, 22, 169, 22, 135, 28, 168, 211, 194, 8, 193, 109, 135,
          207, 211, 26, 118, 218, 230, 211, 39, 35, 150, 208, 203, 230, 31, 206, 210, 188, 83, 46,
          218, 198, 71, 133, 30, 58, 197, 60, 225, 204, 156, 126, 100, 90, 131, 25, 142, 147, 147,
          146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18,
          151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102,
          94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146, 246,
          237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75, 49,
          51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219, 140,
          109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123, 76,
          230, 204, 1, 102, 250, 125, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 62, 32, 93, 180, 241, 155, 55, 182, 1,
          33, 184, 58, 115, 51, 112, 109, 184, 100, 49, 198, 216, 53, 132, 153, 87, 237, 140, 57,
          40, 173, 121, 39, 220, 114, 52, 253, 17, 211, 232, 195, 108, 89, 39, 124, 62, 111, 20,
          157, 92, 211, 207, 169, 166, 42, 238, 73, 248, 19, 9, 98, 180, 179, 185, 25, 94, 138, 165,
          183, 130, 116, 99, 114, 43, 140, 21, 57, 49, 87, 157, 53, 5, 86, 107, 78, 223, 72, 212,
          152, 225, 133, 240, 80, 157, 225, 82, 4, 187, 83, 184, 151, 126, 95, 146, 160, 188, 55,
          39, 66, 196, 131, 9, 68, 165, 155, 79, 230, 177, 192, 70, 110, 42, 109, 173, 18, 43, 93,
          46, 3, 6, 68, 231, 46, 19, 26, 2, 155, 133, 4, 91, 104, 24, 21, 133, 217, 120, 22, 169,
          22, 135, 28, 168, 211, 194, 8, 193, 109, 135, 207, 211, 26, 118, 218, 230, 211, 39, 35,
          150, 208, 203, 230, 31, 206, 210, 188, 83, 46, 218, 198, 71, 133, 30, 58, 197, 60, 225,
          204, 156, 126, 100, 90, 131, 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49,
          251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194,
          24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247,
          94, 218, 221, 70, 222, 189, 92, 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236,
          158, 153, 173, 105, 12, 51, 149, 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220,
          209, 34, 151, 91, 18, 200, 94, 165, 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64,
          143, 227, 209, 231, 105, 12, 67, 211, 123, 76, 230, 204, 1, 102, 250, 125, 170, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          2, 32, 62, 32, 93, 180, 241, 155, 55, 182, 1, 33, 184, 58, 115, 51, 112, 109, 184, 100,
          49, 198, 216, 53, 132, 153, 87, 237, 140, 57, 40, 173, 121, 39, 220, 114, 52, 253, 17,
          211, 232, 195, 108, 89, 39, 124, 62, 111, 20, 157, 92, 211, 207, 169, 166, 42, 238, 73,
          248, 19, 9, 98, 180, 179, 185, 25, 94, 138, 165, 183, 130, 116, 99, 114, 43, 140, 21, 57,
          49, 87, 157, 53, 5, 86, 107, 78, 223, 72, 212, 152, 225, 133, 240, 80, 157, 225, 82, 4,
          187, 83, 184, 151, 126, 95, 146, 160, 188, 55, 39, 66, 196, 131, 9, 68, 165, 155, 79, 230,
          177, 192, 70, 110, 42, 109, 173, 18, 43, 93, 46, 3, 6, 68, 231, 46, 19, 26, 2, 155, 133,
          4, 91, 104, 24, 21, 133, 217, 120, 22, 169, 22, 135, 28, 168, 211, 194, 8, 193, 109, 135,
          207, 211, 26, 118, 218, 230, 211, 39, 35, 150, 208, 203, 230, 31, 206, 210, 188, 83, 46,
          218, 198, 71, 133, 30, 58, 197, 60, 225, 204, 156, 126, 100, 90, 131, 25, 142, 147, 147,
          146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, 53, 169, 231, 18,
          151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, 66, 106, 0, 102,
          94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, 217, 146, 246,
          237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, 188, 75, 49,
          51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, 219, 140,
          109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, 123, 76,
          230, 204, 1, 102, 250, 125, 170,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T14",
      title: "returns success on alt_bn128_pairing_ten_point_match_3",
      test: async function () {
        const byteArray = new Uint8Array([
          16, 84, 86, 163, 51, 230, 214, 54, 133, 79, 152, 126, 167, 187, 113, 61, 253, 10, 232, 55,
          26, 114, 174, 163, 19, 174, 12, 50, 192, 191, 16, 22, 12, 240, 49, 212, 27, 65, 85, 127,
          62, 126, 59, 160, 197, 27, 235, 229, 218, 142, 110, 205, 133, 94, 197, 15, 200, 126, 252,
          222, 172, 22, 139, 204, 4, 118, 190, 9, 58, 109, 43, 75, 191, 144, 113, 114, 4, 152, 116,
          175, 17, 225, 182, 38, 118, 6, 224, 8, 4, 211, 255, 0, 55, 236, 87, 253, 48, 16, 198, 140,
          181, 1, 97, 183, 209, 217, 107, 183, 30, 223, 236, 152, 128, 23, 25, 84, 229, 104, 113,
          171, 243, 217, 60, 201, 77, 116, 95, 161, 20, 192, 89, 215, 78, 91, 108, 78, 193, 74, 229,
          134, 78, 190, 35, 167, 23, 129, 216, 108, 41, 251, 143, 182, 204, 233, 79, 112, 211, 222,
          122, 33, 1, 179, 52, 97, 243, 157, 158, 136, 125, 187, 16, 15, 23, 10, 35, 69, 221, 227,
          192, 126, 37, 109, 29, 250, 43, 101, 123, 165, 205, 3, 4, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 26, 44, 48, 19,
          210, 234, 146, 225, 60, 128, 12, 222, 104, 239, 86, 162, 148, 184, 131, 246, 172, 53, 210,
          95, 88, 124, 9, 177, 179, 198, 53, 247, 41, 1, 88, 168, 12, 211, 214, 101, 48, 247, 77,
          201, 76, 148, 173, 184, 143, 92, 219, 72, 26, 204, 169, 151, 182, 230, 0, 113, 240, 138,
          17, 95, 47, 153, 127, 61, 189, 102, 167, 175, 224, 127, 231, 134, 44, 226, 57, 237, 186,
          158, 5, 197, 175, 255, 127, 138, 18, 89, 201, 115, 59, 45, 251, 185, 41, 209, 105, 21, 48,
          202, 112, 27, 74, 16, 96, 84, 104, 135, 40, 201, 151, 44, 133, 18, 233, 120, 158, 149,
          103, 170, 226, 62, 48, 44, 205, 117,
        ]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(true);
      },
    });

    it({
      id: "T15",
      title: "returns false on incorrect input length",
      test: async function () {
        const byteArray = new Uint8Array([8]);

        await context.writeContract!({
          contractAddress,
          contractName: "PairingChecker",
          functionName: "callBn256Pairing",
          args: [u8aToHex(byteArray)],
          gas: 1_000_000n,
        });
        await context.createBlock();

        expect(
          await context.readContract!({
            contractAddress,
            contractName: "PairingChecker",
            functionName: "status",
          })
        ).to.equals(false);
      },
    });
  },
});
